//
//  ViewController.m
//  Photograph
//
//  Created by dllo on 16/6/14.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ViewController.h"
#import "TouchImage.h"
#import "PhotViewController.h"
@interface ViewController ()<GestureImageViewDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"相册";
    [self tochImage];
}
-(void)tochImage{
    NSString *path = [[NSBundle mainBundle]pathForResource:@"525" ofType:@"png"];
    TouchImage  *image = [[TouchImage alloc]initWithImage:[UIImage imageWithContentsOfFile:path] withFrame:CGRectMake(50, 80, 130, 180)];
    
    image.tag= 1;
    
    [self.view addSubview:image];
    image.delegate =self;
    
    [image release];
    
    NSString *path1 = [[NSBundle mainBundle]pathForResource:@"22" ofType:@"jpg"];
    TouchImage  *image1 = [[TouchImage alloc]initWithImage:[UIImage imageWithContentsOfFile:path1] withFrame:CGRectMake(200, 80, 130, 180)];
    image1.tag = 2;
    
    [self.view addSubview:image1];
    image1.delegate =self;
    [image1 release];
    
    NSString *path2 = [[NSBundle mainBundle]pathForResource:@"333" ofType:@"png"];
    TouchImage  *image2 = [[TouchImage alloc]initWithImage:[UIImage imageWithContentsOfFile:path2] withFrame:CGRectMake(50, 280, 130, 180)];
    image2.tag = 3;
    [self.view addSubview:image2];
    image2.delegate =self;
    [image2 release];
    
    
    NSString *path3 = [[NSBundle mainBundle]pathForResource:@"444" ofType:@"jpg"];
    TouchImage  *image3 = [[TouchImage alloc]initWithImage:[UIImage imageWithContentsOfFile:path3] withFrame:CGRectMake(50, 480, 130, 180)];
    image3.tag = 4;
    [self.view addSubview:image3];
    image3.delegate =self;
    [image3 release];
    
    
    NSString *path4 = [[NSBundle mainBundle]pathForResource:@"555" ofType:@"jpg"];
    TouchImage  *image4 = [[TouchImage alloc]initWithImage:[UIImage imageWithContentsOfFile:path4] withFrame:CGRectMake(200, 280, 130, 180)];
    image4.tag = 5;
    [self.view addSubview:image4];
    image4.delegate =self;
    [image4 release];
    
    
    NSString *path5 = [[NSBundle mainBundle]pathForResource:@"11" ofType:@"jpg"];
    TouchImage  *image5 = [[TouchImage alloc]initWithImage:[UIImage imageWithContentsOfFile:path5] withFrame:CGRectMake(200, 480, 130, 180)];
    image5.tag = 6;
    [self.view addSubview:image5];
    image5.delegate =self;
    [image5 release];
    
}
-(void)next:(TouchImage *)gesture
{
    PhotViewController *pho = [[PhotViewController alloc]init];
    
    pho.photoTag = gesture.tag;
    
    [self.navigationController pushViewController:pho animated:YES];
}


@end
